//
//  UIColor+ZLCategory.m
//  ZLCategory
//
//  Created by zhaozl on 2022/4/26.
//

#import "UIButton+ZLCategory.h"

@implementation UIButton (ZLCategory)

+ (UIButton *)zl_title:(nullable NSString *)title
           selectTitle:(nullable NSString *)selectTitle
                  font:(nullable UIFont *)font
                 image:(nullable UIImage *)image
           selectImage:(nullable UIImage *)selectImage
               spacing:(CGFloat)spacing
                target:(nullable id)target
                action:(nullable SEL)action {
    UIButton *button = [[UIButton alloc] init];
    [button setTitle:title forState:UIControlStateNormal];
    [button setTitle:selectTitle forState:UIControlStateSelected];
    [button setImage:image forState:UIControlStateNormal];
    [button setImage:selectImage forState:UIControlStateSelected];
    button.titleLabel.font = font;
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return button;
}

@end
